home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
003
/
books.arc
/
CURREPT.PRG
< prev
next >
Wrap
Text File
|
1985-04-18
|
3KB
|
118 lines
* Currept.prg
* Print report of current transactions
* First get Company name fro geninfo
use geninfo
store company to company
* Get info on dates, and store
* to search macro (cond)
erase
store ' ' to yn
@ 5,2 say 'Transaction for this month only? ' get yn pict "!"
read
* Set up search condition
* according to user's request.
if !(YN) = "Y"
store "date = '"+$(t:date,1,2)+"'" to cond
store f to range
else
store " " to start,finish
@ 7,2 SAY "Enter starting date " get start pict "99/99/99"
@ 9,2 say "Enter ending date " get finish pict "99/99/99"
read
store "date >= start .and. date <= finish" to cond
store t to range
endi (yn = y)
* next, get sort order
erase
stor 0 to schoice
@ 3,10 say "Sort Orders"
@ 5, 8 say "1. By Account Number"
@ 6, 8 say "2. By Date"
@ 8, 8 say "Enter choice (1-2) " get schoice pict "9"
read
* Set up sort order and report type.
if schoice = 2
use trans index dates
stor "DATES" to roption
else
use trans index acct
stor "ACCTS" to roption
endif
* ask about printer
erase
store ' ' to yn
@ 5,2 say "Send Report to printer? " get yn pict "!"
read
* and set on if necessary
if yn = "Y"
set print on
endif (yn = y)
* mark subaccounts for report.
repl noupdate all marker with " "
repl noupdate all marker with "*";
for acct <> int(acct)
* Calculate Totals, Leaving out subaccounts.
sum amount for acct<300 .and. &cond .and.;
int(acct)=acct to income
sum amount for acct>=300 .and. &cond .and.;
int(acct)=acct to expenses
* print the report using
* predefined report formats
set eject off
erase
? " Income Statement for &company"
?
* Print appropriate subheading
if range
? "For transactions from &start to &finish
else
? "For &t:date"
endif (range)
* Print income transactions
?
? "INCOME:"
repo form &roption for acct<300 .and. &cond plain
? "Total Income "+;
str(income,10,2)
?
* print expenses transactions
? "EXPENSES:"
repo form &roption for acct>=300 .and. &cond plain
? "Total Expenses "+;
str(expenses,10,2)
* display Balance at bottom of sheet
?
? "Total Income "+;
str(Income,10,2)
? "Total Expenses "+;
str(expenses,10,2)
? " ---------"
? "Balance "+;
str(Income - expenses,10,2)
?
? " NOTE: Subaccounts marked with a *"
?? "are noy included in totals."
eject
set print off
* If report not going to printer
* pause on screen
if !(YN) <> "Y"
?
?
? "Press any key to continue"
wait
endif (YN=Y)
release company,yn,cond,start,finish,range
release schoice,roption,income,expense
return